<template>
  <div>
 
    <div class="container">

        <div class="item12">

            <div class="item1">
                <mymenu></mymenu>
            </div>

            <div class="item2">
                <van-field v-model="email" label="用户邮箱" placeholder="请输入用户邮箱"/>

                <van-field v-model="code"  label="激活码" placeholder="激活码"/>

                <van-button type="primary" @click="submit">激活</van-button>

            </div>


        </div>

    </div>

  </div>
</template>

<script>
// 导入子组件
import mymenu from '../components/menu.vue'

export default {
    
 data() {
    return {
        // 设置表单数据
      email:'',
      code:'',

    }



 

  },
  
  components:{
    mymenu
  },
  methods:{


    submit:function(){
        if(this.code == ''){
            this.$toast.fail('请输入激活码')
            return
        }
        this.myaxios(this.baseURL+'user/register','put',{email:this.email,code:this.code}).then(resp=>{
            console.log(resp)
            if(resp.errcode == 0){
               this.$toast.success(resp.msg)
            }else{
                this.$toast.fail(resp.msg)
            }
        })
    }

  },
  created(){

  

  }

}
</script>


<style scoped>
@import url('../assets/style.css');


</style>

